{include file="public:header" /}
<style type="text/css">
    .house_type li{
        float: left;
    }
</style>
<!--添加户型-->
<form id="info_form" action="{:url('editDo')}" method="post" enctype="multipart/form-data">
<input type="hidden" name="house_id" id="house_id" value="{$house_id}" />
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">修改户型信息</li>
            <li><a href="{:url('House/index',['menuid'=>458])}">返回楼盘列表</a></li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th width="120">所属楼盘 :</th>
                        <td>
                            <span id="housename">{$house_title}</span>
                        </td>
                    </tr>

		            <tr>
						<th>户型名称 :</th>
						<td>
							<input type="text" name="title" id="J_title" value="{$info.title}" class="input-text" size="40">
                        </td>
					</tr>
                    <tr>
                        <th>户型 :</th>
                        <td>
                            <input type="text" name="room" id="room" value="{$info.room}" class="input-text" size="5"/><span>室</span>
                            <input type="text" name="ting" id="ting" value="{$info.ting}" class="input-text" size="5"/><span>厅</span>
                            <input type="text" name="wei" id="wei" value="{$info.wei}" class="input-text" size="5"/><span>卫</span>
                            <input type="text" name="chu" id="chu" value="{$info.chu}" class="input-text" size="5"/><span>厨</span>
                            <input type="text" name="yang" id="yang" value="{$info.yang}" class="input-text" size="5"/><span>阳台</span>
                        </td>
                    </tr>
                    <tr>
                        <th>面积 :</th>
                        <td>
                            建筑面积 :<input type="text" name="jianzhu_area" value="{$info.jianzhu_area}" id="jianzhu_area" class="input-text" size="5"/><span>平米</span>
                            套内面积 :<input type="text" name="taonei_area" value="{$info.taonei_area}" id="taonei_area" class="input-text" size="5"/><span>平米</span>
                            公摊面积 :<input type="text" name="gongtan_area" value="{$info.gongtan_area}" id="gongtan_area" class="input-text" size="5"/><span>平米</span>
                        </td>
                    </tr>
                    <tr>
                       <th>价格 :</th>
                        <td>
                            总价 :<input type="text" name="price" id="price" value="{$info.price}" class="input-text" size="5"/><span>万元</span>
                            朝向 :
                            {:getLinkMenu(12,'chaoxiang','select',$info['chaoxiang'],'name')}
                        </td>
                    </tr>
                    <tr>
                        <th>销售状态 :</th>
                        <td>
                            {:getLinkMenu(11,'sale_status','select',$info['sale_status'],'name')}
                        </td>
                    </tr>

                    <tr>
                        <th>户型特色 :</th>
                        <td><textarea name="special" id="special" style="width:500px;height:50px;resize: none;">{$info.special}</textarea></td>
                    </tr>
                    <tr>
                        <th>户型解析 :</th>
                        <td><textarea name="jiexi" id="jiexi" style="width:500px;height:50px;resize: none;">{$info.jiexi}</textarea></td>
                    </tr>

                    <tr>
                        <th>户型图片 :</th>
                        <td><script id="uploadpic" name="uploadpic" type="text/plain"></script>
                           <input type="button" class="btn btn_submit" style="margin:0 0 10px 10px;" onclick="upImage();" value="选择图片">
                            <div id="imageList">
                                <ul class="list clearfix">
                                    {volist name="info.file" id="vo"}
                                        <li>
                                            <img width="113" height="113" alt="{$vo.title}" src="{$vo.url}">
                                            <input type="hidden" value="{$vo.url}" name="pic[pic][]">
                                            <input type="text" class="imgtitletxt" value="{$vo.title}" name="pic[alt][]">
                                            <div class="delbox"><span class="del">删除</span></div>
                                        </li>
                                    {/volist}
                                </ul>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th>主力户型  :</th>
                        <td>
                            <label><input type="radio" name="is_rec" class="radio_style" value="1" {if condition="$info.is_rec eq 1"}checked="checked"{/if}> 是 </label>&nbsp;&nbsp;
                            <label><input type="radio" name="is_rec" class="radio_style" value="0" {if condition="$info.is_rec eq 0"}checked="checked"{/if}>否</label>
                        </td>
                    </tr>
					<tr>
						<th>状态 :</th>
		 				<td>
		                	<label><input type="radio" name="status" class="radio_style" value="1" {if condition="$info.status eq 1"}checked="checked"{/if}> 启用 </label>&nbsp;&nbsp;
							<label><input type="radio" name="status" class="radio_style" value="0" {if condition="$info.status eq 0"}checked="checked"{/if}> 禁用 </label>
						</td>
					</tr>
				</table>
			</div>
            <input type="hidden" name="id" value="{$info.id}">
            </div>
		<div class="mt10"><input type="submit" value="提交" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
{include file="public:footer" /}
<script src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script src="__PUBLIC__/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="__PUBLIC__/js/ueditor/uploadImg.js"></script>
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__PUBLIC__/js/ueditor/';
    window.onload=function(){
        upmoreimg();
    }
</script>
<script type="text/javascript">
    var check_name_url = "{:url('HouseType/ajaxCheckTitle',['id'=>$info['id']])}";
    $(function(){
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_title").formValidator({onshow:"请填写户型名称",onfocus:"请填写户型名称"}).inputValidator({min:1,onerror:"请填写户型名称"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "请填写户型名称",
            onwait : "正在验证"
        }).defaultPassed();
    });

   </script>
</body>
</html>